<?php

$siteId = "";

$commentData = "";

if(@$_GET["siteid"])
	$siteId = $_GET["siteid"];
	
if(@$_GET["editcomment"])
	$commentData = $_GET["editcomment"];
	
$currentTag = $XML1 -> getTag($siteId); 

$oldComment = $currentTag -> getData('x_comment');

$newComment = $oldComment."\n"."------------------------------------------\n".$commentData."\n"." by ".$USER -> getID()."   ".date("Y-m-d H:i:s",time())."\n";
	
$updateSql = "UPDATE ".$PROJECT_DB_TABLES["tags"]." SET x_comment = '".$newComment."',x_modified = '".date("Y-m-d H:i:s",time())."',x_modifiedby = '".$USER -> getID()."' WHERE x_id= '".$siteId."'";

if(executeSQLQuery($updateSql)){
	
	addContent("<b>Page Comment:</b><br/><textarea readonly=\"readonly\" cols=\"60\" rows=\"10\">".$newComment."</textarea><br/><a href= \"javascript:void(0)\" onclick = \"onclick_editpagecomment('".$siteId."','".$currentTag -> getData('x_section')."')\">Edit</a>");
}
else{
	
	addContent("esrgsergrse");
}
	
	
	
?>